/*
 * Copyright © 2011 by PropSage Pte Ltd. 
 * All Rights Reserved.
 * licensing@propsage.com
 * http://www.propsage.com/terms.html
 * 
 * 
 * Javascript for /case/index
 * 
 * @author Poh Nean
 */
propsage.namespace("prestige.invoice");

prestige.invoice.addPayment = (function($, ui){
    function initEventHandlers() {   
        $('#PropertyCasePayment_payment_method').change(onPaymentMethodChange);
    }
    
    function onPaymentMethodChange(event) {
        var method = $('#PropertyCasePayment_payment_method').val();
        
        if (method == 'Other') {
            $('#Payment_payment_method_other').show();
        } else {
            $('#Payment_payment_method_other').hide();
        }
    }
    
    $(document).ready(function(){
        initEventHandlers();
    });
    
}(jQuery, propsage.ui));